from multiprocessing import Process


class MyProcess(Process):
    def __init__(self, name):
        super().__init__()
        self.name = name

    def run(self):
        print(f'子进程{self.name}启动')

if __name__ == '__main__':
    #创建进程
    p1 = MyProcess('进程1')
    p1.start()
